package com.tedu.zweibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class UserLoginDTO {
    @ApiModelProperty(value = "用户名",required = true,example = "niuma")
    //@NotNull不能为空无对象
    //@NotEmpty//不能空瓶有对象无内容也可以验证null
    //@NotBlank(message = "用户名不能为空")//不能空也不能只有空白
    @Pattern(regexp = "[\\u4e00-\\u9fa5a-zA-Z0-9_]{1,20}",message = "用户名只能是1-20个中文活字母或数字活下划线")
    @Size(min = 2,max = 20 ,message = "用户名必须在1-20个字符之间")
    private String username;
    @ApiModelProperty(value = "用户密码",required = true,example = "123456")
    //@NotNull
    //@NotEmpty

    @NotBlank(message = "密码不能为空")
    @Size(min = 6,max = 15 ,message = "密码必须在6-15个字符之间")
    private String password;
}
